Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close automated attack move loophole #6653

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Feb 14, 2025

Issue

The attack move sim callback relies on position data written in lua on the user side, which allows for automation of attack move orders.

Description of the proposed changes

Thanks to an engine patch the sim can inspect a unit's command queue.

  • Change the callback to get the target position from the command queue.
    • There is no way to add a position to that command queue data automatically, so the automation is fixed.
  • related annotations

Testing done on the proposed changes

  • Use the attack move button to issue shift/not shift attack moves
  • Use this script (use in clipboard) to see that it doesn't work for lua script tasks:
    IssueUnitCommandToUnit(GetSelectedUnits()[1], "UNITCOMMAND_Script", {TaskName = 'AttackMove'})
  • And this one to see the callback doesn't work automatically.
    local cb = { Func = "AttackMove", Args = { Clear = true, Target = {50, 50, 50} } }
    SimCallback(cb, true)

An unavoidable part of the implementation since the very beginning is that the unit queue is filled with useless script commands, so the unit is slightly unresponsive as it goes through the script command before moving on to the attack move task.

Checklist

  • Changes are annotated, including comments where useful
  • Changes are documented in the changelog for the next game version

thanks to an engine patch the sim can inspect unit command queues, and that means the attack move callback no longer needs to rely on lua scripted position data
@lL1l1 lL1l1 added type: bug area: sim Area that is affected by the Simulation of the Game labels Feb 14, 2025
@lL1l1 lL1l1 marked this pull request as ready for review February 14, 2025 09:15
@lL1l1 lL1l1 requested a review from 4z0t February 14, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: sim Area that is affected by the Simulation of the Game type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant